package cn.seaboot.admin.security.web;

import cn.seaboot.admin.security.auth.AuthorityType;
import cn.seaboot.admin.security.bean.SecurityChain;
import cn.seaboot.admin.security.service.SecurityChainService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * t_sys_security_chain - Controller
 * <p>
 *
 * @author Mr.css on 2018-6-20
 */
@Controller
@RequestMapping("sys/security/chain")
@Tag(name = "Security权限链配置 管理")
public class SecurityChainCtrl {

    @Resource
    private SecurityChainService securityChainService;

    /**
     * 查列表
     *
     * @return listMap
     */
    @ResponseBody
    @Operation(description = "Security权限链配置列表")
    @RequestMapping(value = "list", method = RequestMethod.GET)
    public List<SecurityChain> queryList() {
        return securityChainService.queryList(AuthorityType.HAS_AUTHORITY);
    }
}
